var app = getApp();
var config = require("../../config.js");
Page({
  data: {
    page: 1,
    pageSize: 5,
    courseList: []
  },
  /**
   * 获取课程列表
   */
  getCourseList() {
    wx.request({
      url: `http://localhost:8080/course/page?page=${this.data.page}&pageSize=${this.data.pageSize}`,
      method: 'GET',
      success: (res) => {
        console.log(res);
        this.setData({
          courseList: [...this.data.courseList, ...res.data.data.records]
        })
      },
      fail: (err) => {

      }
    })
  },
  onLoad: function () {
    this.getCourseList();
  },
})